﻿using Ingenta.Core;
using Ingenta.IServices;
using Ingenta.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Ingenta.WebUI.Controllers
{
    public class HomeController : BaseController
    {
        IUserInfoServices userinfoservice;

        public HomeController(IUserInfoServices userinfs)
        {
            this.userinfoservice = userinfs;
        }

        public ActionResult Index()
        {
            //userinfoservice.Add(new Model.UserInfo()
            //{
            //    ID = Guid.NewGuid(),
            //    Email = "jv_network@outlook.com",
            //    DisplayName = "樊慧",
            //    IsActive = "1",
            //    LoginDate = DateTime.Now,
            //    LoginIp = "114.114.114.114",
            //    Password = "vLFfghR5tNV3K9DKhmwArV+SbjWAcgZZzIDTnJ0JgCo=",
            //    RegistrationTime = DateTime.Now,
            //    RoleId = Guid.Parse("F7AA7F82-D8EF-4B07-8185-E987BE065C88"),
            //    UserName = "fanhui@digital.com"
            //});
            //userinfoservice.SaveChanges();
            //return  Content("添加成功");

            int a = 1;
            int b = 0;
            int c = a / b;
            return View();

            //var userinfo = userinfoservice.QueryWhere(e => e.LoginIp == "192.168.0.1").FirstOrDefault();
            //return Content(userinfo.UserName);
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}